class Dog(object):
    __instance__ = None

    def __new__(cls, name):
        if cls.__instance__ == None:
            cls.__instance__ = object.__new__(cls)
        return cls.__instance__

    def __init__(self, name):
        self.name = name
        print('我被调用了')
try:
  print(num)
except NameError:
  print('没有num对象')
  
a = Dog('zhy')
print(id(a))
print(a.name)

b = Dog('wj')
print(id(b))
print(b.name)



